﻿/*!
 * \file dubbo_serialize_dubbo.c
 *
 * \brief 共通定义
 *
 * All Rights Reserved Copyright (C) 2014 broada,Co.,Ltd.\n
 * 共通使用的宏和结构体
 *
 * \version 1.0
 * \author jikw
 * \date 2016/12/10
 *
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "config.h"
#include "frsutl.h"
#include "frhash2.h"
#include "frct_comm.h"
#include "frservice_comm.h"
#include "frct_detect_hash.h"
#include "frvar_field.h"
#include "dubbo_serialize_dubbo.h"

/*!
 * __serialize_dubbo_readuint
 *
 * \param p_packet
 * \param p_i_value
 *
 * \return FR_SUCC   成功\n
 *         FR_FAIL   失败
 *
 * \note
 *
 */
FR_STATIC int __serialize_dubbo_readuint(Frbyte_Packet *p_packet, int *p_i_value)
{
    int8_t i8_len = 0;
    int i_ret = 0;

    if (p_packet == NULL || p_i_value == NULL)
        return FR_FAIL;

    if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len) == FR_FAIL)
        return FR_FAIL;
    if (i8_len < 0)
    {
        *p_i_value = i8_len & 0x7f;
        return FR_SUCC;
    }

    i_ret = i8_len & 0x7f;

    if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len) == FR_FAIL)
        return FR_FAIL;
    if (i8_len < 0)
        i_ret |= (i8_len & 0x7f) << 7;
    else
    {
        i_ret |= i8_len << 7;
        if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len) == FR_FAIL)
            return FR_FAIL;
        if (i8_len < 0)
            i_ret |= (i8_len & 0x7f) << 14;
        else
        {
            i_ret |= i8_len << 14;
            if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len) == FR_FAIL)
                return FR_FAIL;
            if (i8_len < 0)
                i_ret |= (i8_len & 0x7f) << 21;
            else
            {
                i_ret |= i8_len << 21;
                if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len) == FR_FAIL)
                    return FR_FAIL;
                i_ret |= (i8_len & 0x7f) << 28;
            }
        }
    }
    *p_i_value = i_ret;
    return FR_SUCC;
}

 /*!
 * serialize_dubbo_writestring
 *
 * \param p_packet
 * \param p_st_body_data
 * \param p_name          (上报指标项名字)
 *
 * \return FR_SUCC   成功\n
 *         FR_FAIL   失败
 *
 * \note pp_outbuff内存空间在该函数内部生成,需要在外部释放
 *
 */
int serialize_dubbo_writestring(Frbyte_Packet *p_packet, Frreport_body_data *p_st_body_data, char *p_name)
{
    uint8_t u8_len = 0;
    int i_len = 0;
    int i_temp = 0;
    int i_count = 0;
    char *p_value = NULL;

    if (p_packet == NULL || p_st_body_data == NULL || p_name == NULL)
        return FR_FAIL;

    if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
        return FR_FAIL;

    switch(u8_len)
    {
        case 0x83:
            if (__serialize_dubbo_readuint(p_packet, &i_temp) == FR_FAIL)
                return FR_FAIL;
            for(i_count = 0; i_count<i_temp; i_count++)
            {
                if (bytebuff_peek_char(p_packet, &u8_len) == FR_FAIL)
                    return FR_FAIL;

                if((u8_len & 0x80) == 0)
                    i_len += 1;
                else if((u8_len & 0xE0) == 0xC0)
                    i_len += 2;
                else if((u8_len & 0xF0) == 0xE0)
                    i_len += 3;
                else
                    return FR_FAIL;
            }
            p_value = (char *)frmalloc(i_len+1);
            if (p_value == NULL)
                return FR_FAIL;
            memset(p_value, 0x00, i_len+1);
            if (bytebuff_get_bytes(p_packet, p_value, i_len) == FR_FAIL)
                goto ERROR;
            if (frreport_body_l7_add_str(p_st_body_data, p_name, p_value) == FR_FAIL)
                goto ERROR;
            frfree(p_value);
            break;

        case 0x94:
            if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                return FR_FAIL;
            break;
        case 0x95:
            if (frreport_body_l7_add_str(p_st_body_data, p_name, "") == FR_FAIL)
                return FR_FAIL;
            break;

        default:
            return FR_FAIL;
    }

    return FR_SUCC;

ERROR:
    if (p_value)
        frfree(p_value);
    return FR_FAIL;
}

 /*!
 * __serialize_dubbo_readutf
 *
 * \param p_packet
 * \param pp_data_out
 *
 * \return FR_SUCC   成功\n
 *         FR_FAIL   失败
 *
 * \note pp_outbuff内存空间在该函数内部生成,需要在外部释放
 *
 */
FR_STATIC int __serialize_dubbo_readutf(Frbyte_Packet *p_packet, char **pp_data_out)
{
    uint8_t u8_len = 0;
    int i_len = 0;
    int i_temp = 0;
    int i_count = 0;
    char *p_value = NULL;
    char arr_temp[ARRAY_LEN] = {0};

    if (p_packet == NULL || pp_data_out == NULL)
        return FR_FAIL;

    memset(arr_temp, 0x00, sizeof(arr_temp));

    if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
        return FR_FAIL;

    switch(u8_len)
    {
        case 0x83:
            if (__serialize_dubbo_readuint(p_packet, &i_temp) == FR_FAIL)
                return FR_FAIL;
            for(i_count = 0; i_count < i_temp; i_count++)
            {
                if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                    return FR_FAIL;

                if((u8_len & 0x80) == 0)
                    i_len += 1;
                else if((u8_len & 0xE0) == 0xC0)
                {
                    if (bytebuff_skip(p_packet, 1) != FR_SUCC)
                        goto ERROR;
                    i_len += 2;
                }
                else if((u8_len & 0xF0) == 0xE0)
                {
                    if (bytebuff_skip(p_packet, 2) != FR_SUCC)
                        goto ERROR;
                    i_len += 3;
                }
                else
                    return FR_FAIL;
            }
            if (bytebuffer_backspace(p_packet, i_len) != FR_SUCC)
                goto ERROR;

            p_value = (char *)frmalloc(i_len+1);
            if (p_value == NULL)
                return FR_FAIL;
            memset(p_value, 0x00, i_len+1);
            if (bytebuff_get_bytes(p_packet, p_value, i_len) == FR_FAIL)
                goto ERROR;
            *pp_data_out = p_value;
            break;

        case 0x94: //NULL
            snprintf(arr_temp, sizeof(arr_temp), "%s", "NULL");
            p_value = frstrdup(arr_temp);
            *pp_data_out = p_value;
            break;
        case 0x95:
            snprintf(arr_temp, sizeof(arr_temp), "%s", "");
            p_value = frstrdup(arr_temp);
            *pp_data_out = p_value;
            break;

        default:
            return FR_FAIL;
    }

    return FR_SUCC;

ERROR:
    if (p_value)
        frfree(p_value);
    return FR_FAIL;
}

 /*!
 * __serialize_dubbo_readchar
 *
 * \param p_packet
 * \param pp_data_out
 *
 * \return FR_SUCC   成功\n
 *         FR_FAIL   失败
 *
 * \note //__serialize_dubbo_readint32入参是int  __serialize_dubbo_readchar入参是char
 *
 */
FR_STATIC int __serialize_dubbo_readchar(Frbyte_Packet *p_packet, char **pp_data_out)
{
    int8_t i8_len = 0;
    char arr_value[ARRAY_LEN] = {0};

    if (p_packet == NULL || pp_data_out == NULL)
        return FR_FAIL;

    memset(arr_value, 0x00, sizeof(arr_value));

    if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len) == FR_FAIL)
        return FR_FAIL;

	switch(i8_len)
	{
		case 0x00:
		    if (bytebuff_get_bytes(p_packet, arr_value, 1) == FR_FAIL)
                return FR_FAIL;
            *pp_data_out = frstrdup(arr_value);
            break;
		case 0x01:
		    if (bytebuff_get_bytes(p_packet, arr_value, 2) == FR_FAIL)
                return FR_FAIL;
            *pp_data_out = frstrdup(arr_value);
            break;
		case 0x02:
		    if (bytebuff_get_bytes(p_packet, arr_value, 3) == FR_FAIL)
                return FR_FAIL;
            *pp_data_out = frstrdup(arr_value);
            break;
		case 0x03:
		    if (bytebuff_get_bytes(p_packet, arr_value, 4) == FR_FAIL)
                return FR_FAIL;
            *pp_data_out = frstrdup(arr_value);
            break;

		case 0x0a: *pp_data_out = frstrdup("-15"); break;
		case 0x0b: *pp_data_out = frstrdup("-14"); break;
		case 0x0c: *pp_data_out = frstrdup("-13"); break;
		case 0x0d: *pp_data_out = frstrdup("-12"); break;
		case 0x0e: *pp_data_out = frstrdup("-11"); break;
		case 0x0f: *pp_data_out = frstrdup("-10"); break;
		case 0x10: *pp_data_out = frstrdup("-9"); break;
		case 0x11: *pp_data_out = frstrdup("-8"); break;
		case 0x12: *pp_data_out = frstrdup("-7"); break;
		case 0x13: *pp_data_out = frstrdup("-6"); break;
		case 0x14: *pp_data_out = frstrdup("-5"); break;
		case 0x15: *pp_data_out = frstrdup("-4"); break;
		case 0x16: *pp_data_out = frstrdup("-3"); break;
		case 0x17: *pp_data_out = frstrdup("-2"); break;
		case 0x18: *pp_data_out = frstrdup("-1"); break;
		case 0x19: *pp_data_out = frstrdup("0"); break;
		case 0x1a: *pp_data_out = frstrdup("1"); break;
		case 0x1b: *pp_data_out = frstrdup("2"); break;
		case 0x1c: *pp_data_out = frstrdup("3"); break;
		case 0x1d: *pp_data_out = frstrdup("4"); break;
		case 0x1e: *pp_data_out = frstrdup("5"); break;
		case 0x1f: *pp_data_out = frstrdup("6"); break;
		case 0x20: *pp_data_out = frstrdup("7"); break;
		case 0x21: *pp_data_out = frstrdup("8"); break;
		case 0x22: *pp_data_out = frstrdup("9"); break;
		case 0x23: *pp_data_out = frstrdup("10"); break;
		case 0x24: *pp_data_out = frstrdup("11"); break;
		case 0x25: *pp_data_out = frstrdup("12"); break;
		case 0x26: *pp_data_out = frstrdup("13"); break;
		case 0x27: *pp_data_out = frstrdup("14"); break;
		case 0x28: *pp_data_out = frstrdup("15"); break;
		case 0x29: *pp_data_out = frstrdup("16"); break;
		case 0x2a: *pp_data_out = frstrdup("17"); break;
		case 0x2b: *pp_data_out = frstrdup("18"); break;
		case 0x2c: *pp_data_out = frstrdup("19"); break;
		case 0x2d: *pp_data_out = frstrdup("20"); break;
		case 0x2e: *pp_data_out = frstrdup("21"); break;
		case 0x2f: *pp_data_out = frstrdup("22"); break;
		case 0x30: *pp_data_out = frstrdup("23"); break;
		case 0x31: *pp_data_out = frstrdup("24"); break;
		case 0x32: *pp_data_out = frstrdup("25"); break;
		case 0x33: *pp_data_out = frstrdup("26"); break;
		case 0x34: *pp_data_out = frstrdup("27"); break;
		case 0x35: *pp_data_out = frstrdup("28"); break;
		case 0x36: *pp_data_out = frstrdup("29"); break;
		case 0x37: *pp_data_out = frstrdup("30"); break;
		case 0x38: *pp_data_out = frstrdup("31"); break;

		default:
			return FR_FAIL;
	}

	return FR_SUCC;
}

 /*!
 * __serialize_dubbo_readint32
 *
 * \param p_packet
 * \param p_i_value
 *
 * \return FR_SUCC   成功\n
 *         FR_FAIL   失败
 *
 * \note
 *
 */
FR_STATIC int __serialize_dubbo_readint32(Frbyte_Packet *p_packet, int *p_i_value)
{
    int8_t i8_len = 0;
    int8_t i8_len_1 = 0;
    int8_t i8_len_2 = 0;
    int8_t i8_len_3 = 0;
    int8_t i8_len_4 = 0;
    int i_ret = 0;

    if (p_packet == NULL || p_i_value == NULL)
        return FR_FAIL;

    if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len) == FR_FAIL)
        return FR_FAIL;

	switch(i8_len)
	{
		case 0x00:
		{
            if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_1) == FR_FAIL)
                return FR_FAIL;
            *p_i_value = i8_len_1;
            return FR_SUCC;
		}
		case 0x01:
		{
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_1) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_2) == FR_FAIL)
                return FR_FAIL;
            *p_i_value = (short) ((i8_len_1 & 0xff) | ((i8_len_2 & 0xff) << 8));
            return FR_SUCC;
		}
		case 0x02:
		{
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_1) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_2) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_3) == FR_FAIL)
                return FR_FAIL;
            i_ret = (i8_len_1 & 0xff) | ( (i8_len_2 & 0xff) << 8 ) | ( (i8_len_3 & 0xff) << 16 );
			if (i8_len_3 < 0)
			{
			    *p_i_value = i_ret | 0xff000000;
			    return FR_SUCC;
			}
			*p_i_value = i_ret;
			return FR_SUCC;
		}
		case 0x03:
		{
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_1) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_2) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_3) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_4) == FR_FAIL)
                return FR_FAIL;
			*p_i_value = ( (i8_len_1 & 0xff) | ((i8_len_2 & 0xff) << 8) | ((i8_len_3 & 0xff) << 16) | ((i8_len_4 & 0xff) << 24) );
			return FR_SUCC;
		}

		case 0x0a: *p_i_value = -15; break;
		case 0x0b: *p_i_value = -14; break;
		case 0x0c: *p_i_value = -13; break;
		case 0x0d: *p_i_value = -12; break;
		case 0x0e: *p_i_value = -11; break;
		case 0x0f: *p_i_value = -10; break;
		case 0x10: *p_i_value = -9; break;
		case 0x11: *p_i_value = -8; break;
		case 0x12: *p_i_value = -7; break;
		case 0x13: *p_i_value = -6; break;
		case 0x14: *p_i_value = -5; break;
		case 0x15: *p_i_value = -4; break;
		case 0x16: *p_i_value = -3; break;
		case 0x17: *p_i_value = -2; break;
		case 0x18: *p_i_value = -1; break;
		case 0x19: *p_i_value = 0; break;
		case 0x1a: *p_i_value = 1; break;
		case 0x1b: *p_i_value = 2; break;
		case 0x1c: *p_i_value = 3; break;
		case 0x1d: *p_i_value = 4; break;
		case 0x1e: *p_i_value = 5; break;
		case 0x1f: *p_i_value = 6; break;
		case 0x20: *p_i_value = 7; break;
		case 0x21: *p_i_value = 8; break;
		case 0x22: *p_i_value = 9; break;
		case 0x23: *p_i_value = 10; break;
		case 0x24: *p_i_value = 11; break;
		case 0x25: *p_i_value = 12; break;
		case 0x26: *p_i_value = 13; break;
		case 0x27: *p_i_value = 14; break;
		case 0x28: *p_i_value = 15; break;
		case 0x29: *p_i_value = 16; break;
		case 0x2a: *p_i_value = 17; break;
		case 0x2b: *p_i_value = 18; break;
		case 0x2c: *p_i_value = 19; break;
		case 0x2d: *p_i_value = 20; break;
		case 0x2e: *p_i_value = 21; break;
		case 0x2f: *p_i_value = 22; break;
		case 0x30: *p_i_value = 23; break;
		case 0x31: *p_i_value = 24; break;
		case 0x32: *p_i_value = 25; break;
		case 0x33: *p_i_value = 26; break;
		case 0x34: *p_i_value = 27; break;
		case 0x35: *p_i_value = 28; break;
		case 0x36: *p_i_value = 29; break;
		case 0x37: *p_i_value = 30; break;
		case 0x38: *p_i_value = 31; break;

		default:
			return FR_FAIL;
	}

	return FR_SUCC;
}

 /*!
 * __serialize_dubbo_readint64
 *
 * \param p_packet
 * \param p_i_value
 *
 * \return FR_SUCC   成功\n
 *         FR_FAIL   失败
 *
 * \note
 *
 */
FR_STATIC int __serialize_dubbo_readint64(Frbyte_Packet *p_packet, long *p_i_value)
{
    int8_t i8_len = 0;
    int8_t i8_len_1 = 0;
    int8_t i8_len_2 = 0;
    int8_t i8_len_3 = 0;
    int8_t i8_len_4 = 0;
    int8_t i8_len_5 = 0;
    int8_t i8_len_6 = 0;
    int8_t i8_len_7 = 0;
    int8_t i8_len_8 = 0;
    int i_ret = 0;
    long l_ret = 0;

    if (p_packet == NULL || p_i_value == NULL)
        return FR_FAIL;

    if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len) == FR_FAIL)
        return FR_FAIL;

    switch(i8_len)
    {
    	case 0x00:
		{
            if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_1) == FR_FAIL)
                return FR_FAIL;
            *p_i_value = i8_len_1;
            break;
		}
    	case 0x01:
		{
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_1) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_2) == FR_FAIL)
                return FR_FAIL;
            *p_i_value = (short) ( (i8_len_1 & 0xff) | ((i8_len_2 & 0xff) << 8) );
            break;
		}
    	case 0x02:
		{
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_1) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_2) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_3) == FR_FAIL)
                return FR_FAIL;
            i_ret = (i8_len_1 & 0xff) | ( (i8_len_2 & 0xff) << 8 ) | ( (i8_len_3 & 0xff) << 16 );
			if (i8_len_3 < 0)
			{
                *p_i_value = i_ret | 0xff000000;
                break;
			}
			*p_i_value = i_ret;
			break;
		}
    	case 0x03:
		{
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_1) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_2) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_3) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_4) == FR_FAIL)
                return FR_FAIL;
			*p_i_value = ( (i8_len_1 & 0xff) | ((i8_len_2 & 0xff) << 8) | ((i8_len_3 & 0xff) << 16) | ((i8_len_4 & 0xff) << 24) );
			break;
		}
    	case 0x04:
    	{
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_1) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_2) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_3) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_4) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_5) == FR_FAIL)
                return FR_FAIL;
            l_ret = ( (long)i8_len_1 & 0xff ) |
					( ( (long)i8_len_2 & 0xff ) << 8 ) |
					( ( (long)i8_len_3 & 0xff ) << 16 ) |
					( ( (long)i8_len_4 & 0xff ) << 24 ) |
					( ( (long)i8_len_5 & 0xff ) << 32 );
			if (i8_len_5 < 0)
			{
                *p_i_value = i_ret | 0xffffff0000000000l;
                break;
			}
			*p_i_value = l_ret;
			break;
    	}
    	case 0x05:
    	{
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_1) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_2) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_3) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_4) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_5) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_6) == FR_FAIL)
                return FR_FAIL;
            l_ret = ( (long)i8_len_1 & 0xff ) |
					( ( (long)i8_len_2 & 0xff ) << 8 ) |
					( ( (long)i8_len_3 & 0xff ) << 16 ) |
					( ( (long)i8_len_4 & 0xff ) << 24 ) |
					( ( (long)i8_len_5 & 0xff ) << 32 ) |
					( ( (long)i8_len_6 & 0xff ) << 40 );
			if (i8_len_6 < 0)
			{
                *p_i_value = i_ret | 0xffff000000000000l;
                break;
			}
			*p_i_value = l_ret;
			break;
    	}
    	case 0x06:
    	{
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_1) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_2) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_3) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_4) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_5) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_6) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_7) == FR_FAIL)
                return FR_FAIL;
            l_ret = ( (long)i8_len_1 & 0xff ) |
					( ( (long)i8_len_2 & 0xff ) << 8 ) |
					( ( (long)i8_len_3 & 0xff ) << 16 ) |
					( ( (long)i8_len_4 & 0xff ) << 24 ) |
					( ( (long)i8_len_5 & 0xff ) << 32 ) |
					( ( (long)i8_len_6 & 0xff ) << 40 ) |
					( ( (long)i8_len_7 & 0xff ) << 48 );
			if (i8_len_7 < 0)
			{
                *p_i_value = i_ret | 0xff00000000000000l;
                break;
			}
			*p_i_value = l_ret;
			break;
    	}
    	case 0x07:
    	{
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_1) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_2) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_3) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_4) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_5) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_6) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_7) == FR_FAIL)
                return FR_FAIL;
			if (bytebuff_get_char(p_packet, (uint8_t *)&i8_len_8) == FR_FAIL)
                return FR_FAIL;
            l_ret = ( (long)i8_len_1 & 0xff ) |
					( ( (long)i8_len_2 & 0xff ) << 8 ) |
					( ( (long)i8_len_3 & 0xff ) << 16 ) |
					( ( (long)i8_len_4 & 0xff ) << 24 ) |
					( ( (long)i8_len_5 & 0xff ) << 32 ) |
					( ( (long)i8_len_6 & 0xff ) << 40 ) |
					( ( (long)i8_len_7 & 0xff ) << 48 ) |
					( ( (long)i8_len_8 & 0xff ) << 56 );
			*p_i_value = l_ret;
			break;
    	}

		case 0x0a: *p_i_value = -15; break;
		case 0x0b: *p_i_value = -14; break;
		case 0x0c: *p_i_value = -13; break;
		case 0x0d: *p_i_value = -12; break;
		case 0x0e: *p_i_value = -11; break;
		case 0x0f: *p_i_value = -10; break;
		case 0x10: *p_i_value = -9; break;
		case 0x11: *p_i_value = -8; break;
		case 0x12: *p_i_value = -7; break;
		case 0x13: *p_i_value = -6; break;
		case 0x14: *p_i_value = -5; break;
		case 0x15: *p_i_value = -4; break;
		case 0x16: *p_i_value = -3; break;
		case 0x17: *p_i_value = -2; break;
		case 0x18: *p_i_value = -1; break;
		case 0x19: *p_i_value = 0; break;
		case 0x1a: *p_i_value = 1; break;
		case 0x1b: *p_i_value = 2; break;
		case 0x1c: *p_i_value = 3; break;
		case 0x1d: *p_i_value = 4; break;
		case 0x1e: *p_i_value = 5; break;
		case 0x1f: *p_i_value = 6; break;
		case 0x20: *p_i_value = 7; break;
		case 0x21: *p_i_value = 8; break;
		case 0x22: *p_i_value = 9; break;
		case 0x23: *p_i_value = 10; break;
		case 0x24: *p_i_value = 11; break;
		case 0x25: *p_i_value = 12; break;
		case 0x26: *p_i_value = 13; break;
		case 0x27: *p_i_value = 14; break;
		case 0x28: *p_i_value = 15; break;
		case 0x29: *p_i_value = 16; break;
		case 0x2a: *p_i_value = 17; break;
		case 0x2b: *p_i_value = 18; break;
		case 0x2c: *p_i_value = 19; break;
		case 0x2d: *p_i_value = 20; break;
		case 0x2e: *p_i_value = 21; break;
		case 0x2f: *p_i_value = 22; break;
		case 0x30: *p_i_value = 23; break;
		case 0x31: *p_i_value = 24; break;
		case 0x32: *p_i_value = 25; break;
		case 0x33: *p_i_value = 26; break;
		case 0x34: *p_i_value = 27; break;
		case 0x35: *p_i_value = 28; break;
		case 0x36: *p_i_value = 29; break;
		case 0x37: *p_i_value = 30; break;
		case 0x38: *p_i_value = 31; break;

    	default:
    		return FR_FAIL;
    }

    return FR_SUCC;
}

 /*!
 * __serialize_dubbo_readbyte
 *
 * \param p_packet
 * \param p_i_value
 *
 * \return FR_SUCC   成功\n
 *         FR_FAIL   失败
 *
 * \note
 *
 */
FR_STATIC int __serialize_dubbo_readbyte(Frbyte_Packet *p_packet, char **p_i_value)
{
    uint8_t u8_len = 0;
    char arr_temp[2] = {0};

    if (p_packet == NULL || p_i_value == NULL)
        return FR_FAIL;

    memset(arr_temp, 0x00, sizeof(arr_temp));

    if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
        return FR_FAIL;

    switch(u8_len)
    {
    	case 0:
            if (bytebuff_get_bytes(p_packet, arr_temp, 1) == FR_FAIL)
                return FR_FAIL;
            *p_i_value = frstrdup(arr_temp);
            break;

    	case 25: *p_i_value = frstrdup("0"); break;
    	case 26: *p_i_value = frstrdup("1"); break;
    	case 27: *p_i_value = frstrdup("2"); break;
    	case 28: *p_i_value = frstrdup("3"); break;
    	case 29: *p_i_value = frstrdup("4"); break;
    	case 30: *p_i_value = frstrdup("5"); break;
    	case 31: *p_i_value = frstrdup("6"); break;
    	case 32: *p_i_value = frstrdup("7"); break;
    	case 33: *p_i_value = frstrdup("8"); break;
    	case 34: *p_i_value = frstrdup("9"); break;
    	case 35: *p_i_value = frstrdup("10"); break;
    	case 36: *p_i_value = frstrdup("11"); break;
    	case 37: *p_i_value = frstrdup("12"); break;
    	case 38: *p_i_value = frstrdup("13"); break;
    	case 39: *p_i_value = frstrdup("14"); break;
    	case 40: *p_i_value = frstrdup("15"); break;
    	case 41: *p_i_value = frstrdup("16"); break;
    	case 42: *p_i_value = frstrdup("17"); break;
    	case 43: *p_i_value = frstrdup("18"); break;
    	case 44: *p_i_value = frstrdup("19"); break;
    	case 45: *p_i_value = frstrdup("20"); break;
    	case 46: *p_i_value = frstrdup("21"); break;
    	case 47: *p_i_value = frstrdup("22"); break;
    	case 48: *p_i_value = frstrdup("23"); break;
    	case 49: *p_i_value = frstrdup("24"); break;
    	case 50: *p_i_value = frstrdup("25"); break;
    	case 51: *p_i_value = frstrdup("26"); break;
    	case 52: *p_i_value = frstrdup("27"); break;
    	case 53: *p_i_value = frstrdup("28"); break;
    	case 54: *p_i_value = frstrdup("29"); break;
    	case 55: *p_i_value = frstrdup("30"); break;
    	case 56: *p_i_value = frstrdup("31"); break;

    	default:
    		return FR_FAIL;
    }

    return FR_SUCC;
}

 /*!
 * __serialize_dubbo_readobject_descid
 *
 * \param p_packet
 * \param p_st_body_data
 * \param p_name          (上报指标项名字)
 *
 * \return int
 *
 * \note
 *
 */
FR_STATIC int __serialize_dubbo_readobject_descid(Frbyte_Packet *p_packet, Frreport_body_data *p_st_body_data, char *p_name)
{
    int i_len = 0;
    int i_count = 0;
    int i_type = 0;
    int i_value = 0;
    long l_value = 0;
    uint8_t u8_len = 0;
    char *p_value = NULL;
    char arr_name[ARRAY_LEN] = {0};
    char arr_value[2] = {0};
    union int32_float_bits u_32bits;
    union int64_double_bits u_64bits;

    if (p_packet == NULL || p_st_body_data == NULL || p_name == NULL)
        return FR_FAIL;

    memset(arr_name, 0x00, sizeof(arr_name));
    memset(arr_value, 0x00, sizeof(arr_value));

    if (__serialize_dubbo_readuint(p_packet, &i_type) == FR_FAIL)
        return FR_FAIL;

    switch (i_type)
    {
        case 0://boolean[]
            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                return FR_FAIL;
            if (u8_len == 0x94)
            {
                if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                    return FR_FAIL;
                break;
            }
            else if (u8_len != 0x85)
                return FR_FAIL;

            if (__serialize_dubbo_readuint(p_packet, &i_len) == FR_FAIL)
                return FR_FAIL;
            for(i_count = 0; i_count < i_len; i_count++)
            {
                memset(arr_name, 0x00, sizeof(arr_name));
                snprintf(arr_name, sizeof(arr_name), "%s.list.%d", p_name, i_count+1);

                if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                    return FR_FAIL;
                if (u8_len == 0x18)
                {
                    if (frreport_body_l7_add_str(p_st_body_data, arr_name, "NULL") == FR_FAIL)
                        return FR_FAIL;
                }
                else if (u8_len == 0x19)
                {
                    if (frreport_body_l7_add_str(p_st_body_data, arr_name, "false") == FR_FAIL)
                        return FR_FAIL;
                }
                else if (u8_len == 0x1a)
                {
                    if (frreport_body_l7_add_str(p_st_body_data, arr_name, "true") == FR_FAIL)
                        return FR_FAIL;
                }
                else
                    return FR_FAIL;
            }
            break;

        case 1://byte[]
            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                return FR_FAIL;
            if (u8_len == 0x94 || u8_len == 0x95)
            {
                if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                    return FR_FAIL;
                break;
            }
            else if (u8_len != 0x83)
                return FR_FAIL;

            if (__serialize_dubbo_readuint(p_packet, &i_len) == FR_FAIL)
                return FR_FAIL;
            for(i_count = 0; i_count < i_len; i_count++)
            {
                memset(arr_name, 0x00, sizeof(arr_name));
                snprintf(arr_name, sizeof(arr_name), "%s.list.%d", p_name, i_count+1);
                if (bytebuff_get_bytes(p_packet, arr_value, 1) == FR_FAIL)
                    return FR_FAIL;
                if (frreport_body_l7_add_bin(p_st_body_data, arr_name, arr_value, 1) == FR_FAIL)
                    return FR_FAIL;
            }
            break;

        case 2://char[]
            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                return FR_FAIL;
            if (u8_len == 0x94)
            {
                if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                    return FR_FAIL;
                break;
            }
            else if (u8_len != 0x85)
                return FR_FAIL;

            if (__serialize_dubbo_readuint(p_packet, &i_len) == FR_FAIL)
                return FR_FAIL;
            for(i_count = 0; i_count < i_len; i_count++)
            {
                memset(arr_name, 0x00, sizeof(arr_name));
                snprintf(arr_name, sizeof(arr_name), "%s.list.%d", p_name, i_count+1);

                if (__serialize_dubbo_readchar(p_packet, &p_value) == FR_FAIL)
                    goto ERROR;
                if (frreport_body_l7_add_str(p_st_body_data, arr_name, p_value) == FR_FAIL)
                    goto ERROR;
                frfree(p_value);
                p_value = NULL;
            }
            break;

        case 3://short[]
            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                return FR_FAIL;
            if (u8_len == 0x94)
            {
                if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                    return FR_FAIL;
                break;
            }
            else if (u8_len != 0x85)
                return FR_FAIL;

            if (__serialize_dubbo_readuint(p_packet, &i_len) == FR_FAIL)
                return FR_FAIL;
            for(i_count = 0; i_count < i_len; i_count++)
            {
                memset(arr_name, 0x00, sizeof(arr_name));
                snprintf(arr_name, sizeof(arr_name), "%s.list.%d", p_name, i_count+1);

                if (__serialize_dubbo_readint32(p_packet, &i_value) == FR_FAIL)
                    return FR_FAIL;
                if (frreport_body_l7_add_int(p_st_body_data, arr_name, i_value) == FR_FAIL)
                    return FR_FAIL;
            }
            break;

        case 4://int[]
            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                return FR_FAIL;
            if (u8_len == 0x94)
            {
                if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                    return FR_FAIL;
                break;
            }
            else if (u8_len != 0x85)
                return FR_FAIL;

            if (__serialize_dubbo_readuint(p_packet, &i_len) == FR_FAIL)
                return FR_FAIL;
            for(i_count = 0; i_count < i_len; i_count++)
            {
                memset(arr_name, 0x00, sizeof(arr_name));
                snprintf(arr_name, sizeof(arr_name), "%s.list.%d", p_name, i_count+1);

                if (__serialize_dubbo_readint32(p_packet, &i_value) == FR_FAIL)
                    return FR_FAIL;
                if (frreport_body_l7_add_int(p_st_body_data, arr_name, i_value) == FR_FAIL)
                    return FR_FAIL;
            }
            break;

        case 5://long[]
            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                return FR_FAIL;
            if (u8_len == 0x94)
            {
                if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                    return FR_FAIL;
                break;
            }
            else if (u8_len != 0x85)
                return FR_FAIL;

            if (__serialize_dubbo_readuint(p_packet, &i_len) == FR_FAIL)
                return FR_FAIL;
            for(i_count = 0; i_count < i_len; i_count++)
            {
                memset(arr_name, 0x00, sizeof(arr_name));
                snprintf(arr_name, sizeof(arr_name), "%s.list.%d", p_name, i_count+1);

                if (__serialize_dubbo_readint64(p_packet, &l_value) == FR_FAIL)
                    return FR_FAIL;
                if (frreport_body_l7_add_long(p_st_body_data, arr_name, l_value) == FR_FAIL)
                    return FR_FAIL;
            }
            break;

        case 6://float[]
            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                return FR_FAIL;
            if (u8_len == 0x94)
            {
                if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                    return FR_FAIL;
                break;
            }
            else if (u8_len != 0x85)
                return FR_FAIL;

            if (__serialize_dubbo_readuint(p_packet, &i_len) == FR_FAIL)
                return FR_FAIL;
            for(i_count = 0; i_count < i_len; i_count++)
            {
                memset(arr_name, 0x00, sizeof(arr_name));
                snprintf(arr_name, sizeof(arr_name), "%s.list.%d", p_name, i_count+1);

                if (__serialize_dubbo_readint32(p_packet, &u_32bits.int_bits) == FR_FAIL)
                    return FR_FAIL;
                if (frreport_body_l7_add_float(p_st_body_data, arr_name, u_32bits.float_bits) == FR_FAIL)
                    return FR_FAIL;
            }
            break;

        case 7://double[]
            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                return FR_FAIL;
            if (u8_len == 0x94)
            {
                if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                    return FR_FAIL;
                break;
            }
            else if (u8_len != 0x85)
                return FR_FAIL;

            if (__serialize_dubbo_readuint(p_packet, &i_len) == FR_FAIL)
                return FR_FAIL;
            for(i_count = 0; i_count < i_len; i_count++)
            {
                memset(arr_name, 0x00, sizeof(arr_name));
                snprintf(arr_name, sizeof(arr_name), "%s.list.%d", p_name, i_count+1);

                if (__serialize_dubbo_readint64(p_packet, &u_64bits.int_bits) == FR_FAIL)
                    return FR_FAIL;
                if (frreport_body_l7_add_double(p_st_body_data, arr_name, u_64bits.double_bits) == FR_FAIL)
                    return FR_FAIL;
            }
            break;

        case 8://Boolean
            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                return FR_FAIL;
            if (u8_len == 0x18)
            {
                if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                    return FR_FAIL;
            }
            else if (u8_len == 0x19)
            {
                if (frreport_body_l7_add_str(p_st_body_data, p_name, "false") == FR_FAIL)
                    return FR_FAIL;
            }
            else if (u8_len == 0x1a)
            {
                if (frreport_body_l7_add_str(p_st_body_data, p_name, "true") == FR_FAIL)
                    return FR_FAIL;
            }
            else
                return FR_FAIL;
            break;

        case 9://Byte
            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                return FR_FAIL;
            if (u8_len == 0x94)
            {
                if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                    return FR_FAIL;
                break;
            }
            else if (u8_len != 0x84)
                return FR_FAIL;

            if (__serialize_dubbo_readbyte(p_packet, &p_value) == FR_FAIL)
                goto ERROR;
            if (frreport_body_l7_add_bin(p_st_body_data, p_name, p_value, 1) == FR_FAIL)
                goto ERROR;
            frfree(p_value);
            break;

        case 10://Character
            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                return FR_FAIL;
            if (u8_len == 0x94)
            {
                if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                    return FR_FAIL;
                break;
            }
            else if (u8_len != 0x84)
                return FR_FAIL;
            if (__serialize_dubbo_readchar(p_packet, &p_value) == FR_FAIL)
                goto ERROR;
            if (frreport_body_l7_add_str(p_st_body_data, p_name, p_value) == FR_FAIL)
                goto ERROR;
            frfree(p_value);
            break;

        case 11://Short
            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                return FR_FAIL;
            if (u8_len == 0x94)
            {
                if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                    return FR_FAIL;
                break;
            }
            else if (u8_len != 0x84)
                return FR_FAIL;
            if (__serialize_dubbo_readint32(p_packet, &i_value) == FR_FAIL)
                return FR_FAIL;
            if (frreport_body_l7_add_int(p_st_body_data, p_name, i_value) == FR_FAIL)
                return FR_FAIL;
            break;

        case 12://Integer
            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                return FR_FAIL;
            if (u8_len == 0x94)
            {
                if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                    return FR_FAIL;
                break;
            }
            else if (u8_len != 0x84)
                return FR_FAIL;
            if (__serialize_dubbo_readint32(p_packet, &i_value) == FR_FAIL)
                return FR_FAIL;
            if (frreport_body_l7_add_int(p_st_body_data, p_name, i_value) == FR_FAIL)
                return FR_FAIL;
            break;

        case 13://Long
            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                return FR_FAIL;
            if (u8_len == 0x94)
            {
                if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                    return FR_FAIL;
                break;
            }
            else if (u8_len != 0x84)
                return FR_FAIL;
            if (__serialize_dubbo_readint64(p_packet, &l_value) == FR_FAIL)
                return FR_FAIL;
            if (frreport_body_l7_add_long(p_st_body_data, p_name, l_value) == FR_FAIL)
                return FR_FAIL;
            break;

        case 14://Float
            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                return FR_FAIL;
            if (u8_len == 0x94)
            {
                if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                    return FR_FAIL;
                break;
            }
            else if (u8_len != 0x84)
                return FR_FAIL;

            if (__serialize_dubbo_readint32(p_packet, &u_32bits.int_bits) == FR_FAIL)
                return FR_FAIL;
            if (frreport_body_l7_add_float(p_st_body_data, p_name, u_32bits.float_bits) == FR_FAIL)
                return FR_FAIL;
            break;

        case 15://Double
            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                return FR_FAIL;
            if (u8_len == 0x94)
            {
                if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                    return FR_FAIL;
                break;
            }
            else if (u8_len != 0x84)
                return FR_FAIL;
            if (__serialize_dubbo_readint64(p_packet, &u_64bits.int_bits) == FR_FAIL)
                return FR_FAIL;
            if (frreport_body_l7_add_double(p_st_body_data, p_name, u_64bits.double_bits) == FR_FAIL)
                return FR_FAIL;
            break;

        case 16://String
            if (__serialize_dubbo_readutf(p_packet, &p_value) == FR_FAIL)
                goto ERROR;
            if (frreport_body_l7_add_str(p_st_body_data, p_name, p_value) == FR_FAIL)
                goto ERROR;
            frfree(p_value);
            break;

        case 17://String[]
            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                return FR_FAIL;
            if (u8_len == 0x94)
            {
                if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                    return FR_FAIL;
                break;
            }
            else if (u8_len != 0x85)
                return FR_FAIL;

            if (__serialize_dubbo_readuint(p_packet, &i_len) == FR_FAIL)
                return FR_FAIL;
            for(i_count = 0; i_count < i_len; i_count++)
            {
                memset(arr_name, 0x00, sizeof(arr_name));
                snprintf(arr_name, sizeof(arr_name), "%s.list.%d", p_name, i_count+1);

                if (__serialize_dubbo_readutf(p_packet, &p_value) == FR_FAIL)
                    goto ERROR;
                if (frreport_body_l7_add_str(p_st_body_data, arr_name, p_value) == FR_FAIL)
                    goto ERROR;
                frfree(p_value);
                p_value = NULL;
            }
            break;

        case 18://ArrayList
            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                return FR_FAIL;
            if (u8_len == 0x94)
            {
                if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                    return FR_FAIL;
                break;
            }
            else if (u8_len != 0x85)
                return FR_FAIL;

            if (__serialize_dubbo_readuint(p_packet, &i_len) == FR_FAIL)
                return FR_FAIL;
            for(i_count = 0; i_count < i_len; i_count++)
            {
                memset(arr_name, 0x00, sizeof(arr_name));
                snprintf(arr_name, sizeof(arr_name), "%s.list.%d", p_name, i_count+1);

                if (serialize_dubbo_readobject(p_packet, p_st_body_data, arr_name) == FR_FAIL)
                    return FR_FAIL;
            }
            break;

        case 19://HashMap
            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                return FR_FAIL;
            if (u8_len == 0x94)
            {
                if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                    return FR_FAIL;
                break;
            }
            else if (u8_len != 0x86)
                return FR_FAIL;

            if (__serialize_dubbo_readuint(p_packet, &i_len) == FR_FAIL)
                return FR_FAIL;
            for(i_count = 0; i_count < i_len; i_count++)
            {
                if (bytebuff_skip(p_packet, 2) != FR_SUCC)
                    goto ERROR;
                //取key值组成名字
                if (__serialize_dubbo_readutf(p_packet, &p_value) == FR_FAIL)
                    goto ERROR;
                memset(arr_name, 0x00, sizeof(arr_name));
                snprintf(arr_name, sizeof(arr_name), "%s.fields.%s", p_name, p_value);

                //取value值
                if (serialize_dubbo_readobject(p_packet, p_st_body_data, arr_name) == FR_FAIL)
                    goto ERROR;

                frfree(p_value);
                p_value = NULL;
            }
            break;

        case 20://HashSet
            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                return FR_FAIL;
            if (u8_len == 0x94)
            {
                if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                    return FR_FAIL;
                break;
            }
            else if (u8_len != 0x85)
                return FR_FAIL;

            if (__serialize_dubbo_readuint(p_packet, &i_len) == FR_FAIL)
                return FR_FAIL;
            for(i_count = 0; i_count < i_len; i_count++)
            {
                memset(arr_name, 0x00, sizeof(arr_name));
                snprintf(arr_name, sizeof(arr_name), "%s.fields.%d", p_name, i_count+1);

                //取value值
                if (serialize_dubbo_readobject(p_packet, p_st_body_data, arr_name) == FR_FAIL)
                    goto ERROR;
            }
            break;

        case 21://Date
        case 22://java.sql.Date
        case 23://java.sql.Time
        case 24://java.sql.Timestamp
            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                return FR_FAIL;
            if (u8_len == 0x94)
            {
                if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                    return FR_FAIL;
                break;
            }
            else if (u8_len != 0x84)
                return FR_FAIL;
            if (__serialize_dubbo_readint64(p_packet, &l_value) == FR_FAIL)
                return FR_FAIL;
            if (frreport_body_l7_add_long(p_st_body_data, p_name, l_value) == FR_FAIL)
                return FR_FAIL;
            break;

        default:
            return FR_FAIL;
    }

    return FR_SUCC;

ERROR:
    if (p_value)
        frfree(p_value);
    return FR_FAIL;
}

 /*!
 * __serialize_dubbo_readobject_desc
 *
 * \param p_packet
 * \param p_st_body_data
 * \param p_name          (上报指标项名字)
 *
 * \return int
 *
 * \note
 *
 */
FR_STATIC int __serialize_dubbo_readobject_desc(Frbyte_Packet *p_packet, Frreport_body_data *p_st_body_data, char *p_name)
{
    int i_len = 0;
    int i_count = 0;
    int i_value = 0;
    long l_value = 0;
    uint8_t u8_len = 0;
    char *p_value = NULL;
    char *p_type = NULL;
    char arr_name[ARRAY_LEN] = {0};
    char arr_temp[ARRAY_LEN] = {0};
    char arr_value[2] = {0};
    union int32_float_bits u_32bits;
    union int64_double_bits u_64bits;

    if (p_packet == NULL || p_st_body_data == NULL || p_name == NULL)
        return FR_FAIL;

    memset(arr_name, 0x00, sizeof(arr_name));
    memset(arr_temp, 0x00, sizeof(arr_temp));
    memset(arr_value, 0x00, sizeof(arr_value));

    if (__serialize_dubbo_readutf(p_packet, &p_type) == FR_FAIL)
        goto ERROR;
    snprintf(arr_name, sizeof(arr_name), "%s.%s", p_name, "type");
    if (frreport_body_l7_add_str(p_st_body_data, arr_name, p_type) == FR_FAIL)
        goto ERROR;

    if (strcmp(p_type, "[Ljava/lang/Boolean;") == 0)
    {
        if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
            goto ERROR;
        if (u8_len == 0x94)
        {
            if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                goto ERROR;
            frfree(p_type);
            return FR_SUCC;
        }
        else if (u8_len != 0x85)
            goto ERROR;

        if (__serialize_dubbo_readuint(p_packet, &i_len) == FR_FAIL)
            goto ERROR;
        for(i_count = 0; i_count < i_len; i_count++)
        {
            memset(arr_name, 0x00, sizeof(arr_name));
            snprintf(arr_name, sizeof(arr_name), "%s.list.%d", p_name, i_count+1);

            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                goto ERROR;
            if (u8_len == 0x18)
            {
                if (frreport_body_l7_add_str(p_st_body_data, arr_name, "NULL") == FR_FAIL)
                    goto ERROR;
            }
            else if (u8_len == 0x19)
            {
                if (frreport_body_l7_add_str(p_st_body_data, arr_name, "false") == FR_FAIL)
                    goto ERROR;
            }
            else if (u8_len == 0x1a)
            {
                if (frreport_body_l7_add_str(p_st_body_data, arr_name, "true") == FR_FAIL)
                    goto ERROR;
            }
            else
                goto ERROR;
        }
    }
    else if (strcmp(p_type, "[Ljava/lang/Byte;") == 0)
    {
        if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
            goto ERROR;
        if (u8_len == 0x94)
        {
            if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                goto ERROR;
            frfree(p_type);
            return FR_SUCC;
        }
        else if (u8_len != 0x85)
            goto ERROR;

        if (__serialize_dubbo_readuint(p_packet, &i_len) == FR_FAIL)
            goto ERROR;
        for(i_count = 0; i_count < i_len; i_count++)
        {
            memset(arr_name, 0x00, sizeof(arr_name));
            snprintf(arr_name, sizeof(arr_name), "%s.list.%d", p_name, i_count+1);

            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                goto ERROR;
            if (u8_len == 0x94)
            {
                if (frreport_body_l7_add_str(p_st_body_data, arr_name, "NULL") == FR_FAIL)
                    goto ERROR;
                break;
            }
            else if (u8_len != 0x84)
                goto ERROR;

            if (bytebuff_get_bytes(p_packet, arr_value, 1) == FR_FAIL)
                return FR_FAIL;
            if (frreport_body_l7_add_bin(p_st_body_data, arr_name, arr_value, 1) == FR_FAIL)
                return FR_FAIL;
        }
    }
    else if (strcmp(p_type, "[Ljava/lang/Character;") == 0)
    {
        if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
            goto ERROR;
        if (u8_len == 0x94)
        {
            if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                goto ERROR;
            frfree(p_type);
            return FR_SUCC;
        }
        else if (u8_len != 0x85)
            goto ERROR;

        if (__serialize_dubbo_readuint(p_packet, &i_len) == FR_FAIL)
            goto ERROR;
        for(i_count = 0; i_count < i_len; i_count++)
        {
            memset(arr_name, 0x00, sizeof(arr_name));
            snprintf(arr_name, sizeof(arr_name), "%s.list.%d", p_name, i_count+1);

            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                goto ERROR;
            if (u8_len == 0x94)
            {
                if (frreport_body_l7_add_str(p_st_body_data, arr_name, "NULL") == FR_FAIL)
                    goto ERROR;
                break;
            }
            else if (u8_len != 0x84)
                goto ERROR;

            if (__serialize_dubbo_readchar(p_packet, &p_value) == FR_FAIL)
                goto ERROR;
            if (frreport_body_l7_add_str(p_st_body_data, arr_name, p_value) == FR_FAIL)
                goto ERROR;
            frfree(p_value);
            p_value = NULL;
        }
    }
    else if (strcmp(p_type, "[Ljava/lang/Short;") == 0)
    {
        if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
            goto ERROR;
        if (u8_len == 0x94)
        {
            if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                goto ERROR;
            frfree(p_type);
            return FR_SUCC;
        }
        else if (u8_len != 0x85)
            goto ERROR;

        if (__serialize_dubbo_readuint(p_packet, &i_len) == FR_FAIL)
            goto ERROR;
        for(i_count = 0; i_count < i_len; i_count++)
        {
            memset(arr_name, 0x00, sizeof(arr_name));
            snprintf(arr_name, sizeof(arr_name), "%s.list.%d", p_name, i_count+1);

            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                goto ERROR;
            if (u8_len == 0x94)
            {
                if (frreport_body_l7_add_str(p_st_body_data, arr_name, "NULL") == FR_FAIL)
                    goto ERROR;
                break;
            }
            else if (u8_len != 0x84)
                goto ERROR;

            if (__serialize_dubbo_readint32(p_packet, &i_value) == FR_FAIL)
                goto ERROR;
            if (frreport_body_l7_add_int(p_st_body_data, arr_name, i_value) == FR_FAIL)
                goto ERROR;
        }
    }
    else if (strcmp(p_type, "[Ljava/lang/Integer;") == 0)
    {
        if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
            goto ERROR;
        if (u8_len == 0x94)
        {
            if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                goto ERROR;
            frfree(p_type);
            return FR_SUCC;
        }
        else if (u8_len != 0x85)
            goto ERROR;

        if (__serialize_dubbo_readuint(p_packet, &i_len) == FR_FAIL)
            goto ERROR;
        for(i_count = 0; i_count < i_len; i_count++)
        {
            memset(arr_name, 0x00, sizeof(arr_name));
            snprintf(arr_name, sizeof(arr_name), "%s.list.%d", p_name, i_count+1);

            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                goto ERROR;
            if (u8_len == 0x94)
            {
                if (frreport_body_l7_add_str(p_st_body_data, arr_name, "NULL") == FR_FAIL)
                    goto ERROR;
                break;
            }
            else if (u8_len != 0x84)
                goto ERROR;

            if (__serialize_dubbo_readint32(p_packet, &i_value) == FR_FAIL)
                goto ERROR;
            if (frreport_body_l7_add_int(p_st_body_data, arr_name, i_value) == FR_FAIL)
                goto ERROR;
        }
    }
    else if (strcmp(p_type, "[Ljava/lang/Long;") == 0)
    {
        if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
            goto ERROR;
        if (u8_len == 0x94)
        {
            if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                goto ERROR;
            frfree(p_type);
            return FR_SUCC;
        }
        else if (u8_len != 0x85)
            goto ERROR;

        if (__serialize_dubbo_readuint(p_packet, &i_len) == FR_FAIL)
            goto ERROR;
        for(i_count = 0; i_count < i_len; i_count++)
        {
            memset(arr_name, 0x00, sizeof(arr_name));
            snprintf(arr_name, sizeof(arr_name), "%s.list.%d", p_name, i_count+1);

            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                goto ERROR;
            if (u8_len == 0x94)
            {
                if (frreport_body_l7_add_str(p_st_body_data, arr_name, "NULL") == FR_FAIL)
                    goto ERROR;
                break;
            }
            else if (u8_len != 0x84)
                goto ERROR;

            if (__serialize_dubbo_readint64(p_packet, &l_value) == FR_FAIL)
                goto ERROR;
            if (frreport_body_l7_add_long(p_st_body_data, arr_name, l_value) == FR_FAIL)
                goto ERROR;
        }
    }
    else if (strcmp(p_type, "[Ljava/lang/Float;") == 0)
    {
        if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
            goto ERROR;
        if (u8_len == 0x94)
        {
            if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                goto ERROR;
            frfree(p_type);
            return FR_SUCC;
        }
        else if (u8_len != 0x85)
            goto ERROR;

        if (__serialize_dubbo_readuint(p_packet, &i_len) == FR_FAIL)
            goto ERROR;
        for(i_count = 0; i_count < i_len; i_count++)
        {
            memset(arr_name, 0x00, sizeof(arr_name));
            snprintf(arr_name, sizeof(arr_name), "%s.list.%d", p_name, i_count+1);

            if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
                goto ERROR;
            if (u8_len == 0x94)
            {
                if (frreport_body_l7_add_str(p_st_body_data, arr_name, "NULL") == FR_FAIL)
                    goto ERROR;
                break;
            }
            else if (u8_len != 0x84)
                goto ERROR;

            if (__serialize_dubbo_readint32(p_packet, &u_32bits.int_bits) == FR_FAIL)
                goto ERROR;
            if (frreport_body_l7_add_float(p_st_body_data, arr_name, u_32bits.float_bits) == FR_FAIL)
                goto ERROR;
        }
    }
    else if (strcmp(p_type, "Boolean;") == 0)
    {
        if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
            goto ERROR;
        if (u8_len == 0x18)
        {
            if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                goto ERROR;
        }
        else if (u8_len == 0x19)
        {
            if (frreport_body_l7_add_str(p_st_body_data, p_name, "false") == FR_FAIL)
                goto ERROR;
        }
        else if (u8_len == 0x1a)
        {
            if (frreport_body_l7_add_str(p_st_body_data, p_name, "true") == FR_FAIL)
                goto ERROR;
        }
        else
            goto ERROR;
    }
    else if (strcmp(p_type, "Byte;") == 0)
    {
        if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
            goto ERROR;
        if (u8_len == 0x94)
        {
            if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                goto ERROR;
            frfree(p_type);
            return FR_SUCC;
        }
        else if (u8_len != 0x84)
            goto ERROR;
        if (__serialize_dubbo_readbyte(p_packet, &p_value) == FR_FAIL)
            goto ERROR;
        if (frreport_body_l7_add_bin(p_st_body_data, p_name, p_value, 1) == FR_FAIL)
            goto ERROR;
        frfree(p_value);
    }
    else if (strcmp(p_type, "Character;") == 0)
    {
        if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
            goto ERROR;
        if (u8_len == 0x94)
        {
            if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                goto ERROR;
            frfree(p_type);
            return FR_SUCC;
        }
        else if (u8_len != 0x84)
            goto ERROR;
        if (__serialize_dubbo_readchar(p_packet, &p_value) == FR_FAIL)
            goto ERROR;
        if (frreport_body_l7_add_str(p_st_body_data, p_name, p_value) == FR_FAIL)
            goto ERROR;
        frfree(p_value);
    }
    else if (strcmp(p_type, "Short;") == 0)
    {
        if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
            goto ERROR;
        if (u8_len == 0x94)
        {
            if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                goto ERROR;
            frfree(p_type);
            return FR_SUCC;
        }
        else if (u8_len != 0x84)
            goto ERROR;
        if (__serialize_dubbo_readint32(p_packet, &i_value) == FR_FAIL)
            goto ERROR;
        if (frreport_body_l7_add_int(p_st_body_data, p_name, i_value) == FR_FAIL)
            goto ERROR;
    }
    else if (strcmp(p_type, "Integer;") == 0)
    {
        if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
            goto ERROR;
        if (u8_len == 0x94)
        {
            if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                goto ERROR;
            frfree(p_type);
            return FR_SUCC;
        }
        else if (u8_len != 0x84)
            goto ERROR;
        if (__serialize_dubbo_readint32(p_packet, &i_value) == FR_FAIL)
            goto ERROR;
        if (frreport_body_l7_add_int(p_st_body_data, p_name, i_value) == FR_FAIL)
            goto ERROR;
    }
    else if (strcmp(p_type, "Long;") == 0)
    {
        if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
            goto ERROR;
        if (u8_len == 0x94)
        {
            if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                goto ERROR;
            frfree(p_type);
            return FR_SUCC;
        }
        else if (u8_len != 0x84)
            goto ERROR;
        if (__serialize_dubbo_readint64(p_packet, &l_value) == FR_FAIL)
            goto ERROR;
        if (frreport_body_l7_add_long(p_st_body_data, p_name, l_value) == FR_FAIL)
            goto ERROR;
    }
    else if (strcmp(p_type, "Float;") == 0)
    {
        if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
            goto ERROR;
        if (u8_len == 0x94)
        {
            if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                goto ERROR;
            frfree(p_type);
            return FR_SUCC;
        }
        else if (u8_len != 0x84)
            goto ERROR;

        if (__serialize_dubbo_readint32(p_packet, &u_32bits.int_bits) == FR_FAIL)
            goto ERROR;
        if (frreport_body_l7_add_float(p_st_body_data, p_name, u_32bits.float_bits) == FR_FAIL)
            goto ERROR;
    }
    else if (strcmp(p_type, "Double;") == 0)
    {
        if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
            goto ERROR;
        if (u8_len == 0x94)
        {
            if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                goto ERROR;
            frfree(p_type);
            return FR_SUCC;
        }
        else if (u8_len != 0x84)
            goto ERROR;
        if (__serialize_dubbo_readint64(p_packet, &u_64bits.int_bits) == FR_FAIL)
            goto ERROR;
        if (frreport_body_l7_add_double(p_st_body_data, p_name, u_64bits.double_bits) == FR_FAIL)
            goto ERROR;
    }
    else if (strcmp(p_type, "String;") == 0)
    {
        if (__serialize_dubbo_readutf(p_packet, &p_value) == FR_FAIL)
            goto ERROR;
        if (frreport_body_l7_add_str(p_st_body_data, p_name, p_value) == FR_FAIL)
            goto ERROR;
        frfree(p_value);
    }
    else if (strcmp(p_type, "[Ljava/lang/String;") == 0)
    {
        if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
            goto ERROR;
        if (u8_len == 0x94)
        {
            if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                goto ERROR;
            frfree(p_type);
            return FR_SUCC;
        }
        else if (u8_len != 0x85)
            goto ERROR;

        if (__serialize_dubbo_readuint(p_packet, &i_len) == FR_FAIL)
            goto ERROR;
        for(i_count = 0; i_count < i_len; i_count++)
        {
            memset(arr_name, 0x00, sizeof(arr_name));
            snprintf(arr_name, sizeof(arr_name), "%s.list.%d", p_name, i_count+1);

            if (__serialize_dubbo_readutf(p_packet, &p_value) == FR_FAIL)
                goto ERROR;
            if (frreport_body_l7_add_str(p_st_body_data, arr_name, p_value) == FR_FAIL)
                goto ERROR;
            frfree(p_value);
            p_value = NULL;
        }
    }
    else if (strcmp(p_type, "ArrayList;") == 0)
    {
        if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
            goto ERROR;
        if (u8_len == 0x94)
        {
            if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                goto ERROR;
            frfree(p_type);
            return FR_SUCC;
        }
        else if (u8_len != 0x85)
            goto ERROR;

        if (__serialize_dubbo_readuint(p_packet, &i_len) == FR_FAIL)
            goto ERROR;
        for(i_count = 0; i_count < i_len; i_count++)
        {
            memset(arr_name, 0x00, sizeof(arr_name));
            snprintf(arr_name, sizeof(arr_name), "%s.list.%d", p_name, i_count+1);

            if (serialize_dubbo_readobject(p_packet, p_st_body_data, arr_name) == FR_FAIL)
                goto ERROR;
        }
    }
    else if (strcmp(p_type, "HashMap;") == 0)
    {
        if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
            goto ERROR;
        if (u8_len == 0x94)
        {
            if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                goto ERROR;
            frfree(p_type);
            return FR_SUCC;
        }
        else if (u8_len != 0x86)
            goto ERROR;

        if (__serialize_dubbo_readuint(p_packet, &i_len) == FR_FAIL)
            goto ERROR;
        for(i_count = 0; i_count < i_len; i_count++)
        {
            if (bytebuff_skip(p_packet, 2) != FR_SUCC)
                goto ERROR;
            //取key值组成名字
            if (__serialize_dubbo_readutf(p_packet, &p_value) == FR_FAIL)
                goto ERROR;
            memset(arr_name, 0x00, sizeof(arr_name));
            snprintf(arr_name, sizeof(arr_name), "%s.fields.%s", p_name, p_value);

            //取value值
            if (serialize_dubbo_readobject(p_packet, p_st_body_data, arr_name) == FR_FAIL)
                goto ERROR;

            frfree(p_value);
            p_value = NULL;
        }
    }
    else if (strcmp(p_type, "HashSet;") == 0)
    {
        if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
            goto ERROR;
        if (u8_len == 0x94)
        {
            if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                goto ERROR;
            frfree(p_type);
            return FR_SUCC;
        }
        else if (u8_len != 0x85)
            goto ERROR;

        if (__serialize_dubbo_readuint(p_packet, &i_len) == FR_FAIL)
            goto ERROR;
        for(i_count = 0; i_count < i_len; i_count++)
        {
            memset(arr_name, 0x00, sizeof(arr_name));
            snprintf(arr_name, sizeof(arr_name), "%s.fields.%d", p_name, i_count+1);

            //取value值
            if (serialize_dubbo_readobject(p_packet, p_st_body_data, arr_name) == FR_FAIL)
                goto ERROR;
        }
    }
    else if (strcmp(p_type, "Date;") == 0 ||
        strcmp(p_type, "java.sql.Date;") == 0 ||
        strcmp(p_type, "java.sql.Time;") == 0 ||
        strcmp(p_type, "java.sql.Timestamp;") == 0)
    {
        if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
            goto ERROR;
        if (u8_len == 0x94)
        {
            if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                goto ERROR;
            frfree(p_type);
            return FR_SUCC;
        }
        else if (u8_len != 0x84)
            goto ERROR;
        if (__serialize_dubbo_readint64(p_packet, &l_value) == FR_FAIL)
            goto ERROR;
        if (frreport_body_l7_add_long(p_st_body_data, p_name, l_value) == FR_FAIL)
            goto ERROR;
    }

    frfree(p_type);
    return FR_SUCC;

ERROR:
    if (p_type)
        frfree(p_type);
    if (p_value)
        frfree(p_value);
    return FR_FAIL;
}

 /*!
 * serialize_dubbo_readobject
 *
 * \param p_packet        (resp数据)
 * \param p_st_body_data
 * \param p_name          (上报指标项名字)
 *
 * \return int
 *
 * \note
 *
 */
int serialize_dubbo_readobject(Frbyte_Packet *p_packet, Frreport_body_data *p_st_body_data, char *p_name)
{
    uint8_t u8_len = 0;
    char arr_name[ARRAY_LEN] = {0};

    if (p_packet == NULL || p_st_body_data == NULL || p_name == NULL)
        return FR_FAIL;

    memset(arr_name, 0x00, sizeof(arr_name));

    if (bytebuff_get_char(p_packet, &u8_len) == FR_FAIL)
        return FR_FAIL;

    switch(u8_len)
    {
        case 0x94://OBJECT_NULL
            if (frreport_body_l7_add_str(p_st_body_data, p_name, "NULL") == FR_FAIL)
                return FR_FAIL;
            break;
        case 0x95://OBJECT_DUMMY
            if (serialize_dubbo_readobject(p_packet, p_st_body_data, p_name) == FR_FAIL)
                return FR_FAIL;
            break;
        case 0x8a://OBJECT_DESC
            if (__serialize_dubbo_readobject_desc(p_packet, p_st_body_data, p_name) == FR_FAIL)
                return FR_FAIL;
            break;
        case 0x8b://OBJECT_DESC_ID
            if (__serialize_dubbo_readobject_descid(p_packet, p_st_body_data, p_name) == FR_FAIL)
                return FR_FAIL;
            break;
        default:
            return FR_FAIL;
    }

    return FR_SUCC;
}

 /*!
 * serialize_dubbo_req_body_parse
 *
 * \param p_packet        (resp数据)
 * \param p_st_body_data
 *
 * \return APM_L7_ANALYZE_SUCC   成功\n
 *         APM_L7_ANALYZE_FAIL   失败
 *
 * \note
 *
 */
int serialize_dubbo_req_body_parse(Frbyte_Packet *p_packet, Frreport_body_data *p_st_body_data)
{
    int i_ret = 0;
    int i_count = 0;
    char arr_name[ARRAY_LEN] = {0};

    if (p_packet == NULL || p_st_body_data == NULL)
        return APM_L7_ANALYZE_FAIL;

    memset(arr_name, 0x00, sizeof(arr_name));

    //取dubbo版本"request.rpc.version"
    i_ret = serialize_dubbo_writestring(p_packet, p_st_body_data, (char *)"request.rpc.dubbo.version");
    if (i_ret == FR_FAIL)
        return APM_L7_ANALYZE_FAIL;

    //取path服务名
    i_ret = serialize_dubbo_writestring(p_packet, p_st_body_data, (char *)"request.rpc.path");
    if (i_ret == FR_FAIL)
        return APM_L7_ANALYZE_FAIL;

    //取服务版本
    i_ret = serialize_dubbo_writestring(p_packet, p_st_body_data, (char *)"request.rpc.path.version");
    if (i_ret == FR_FAIL)
        return APM_L7_ANALYZE_FAIL;

    //取调用服务的方法
    i_ret = serialize_dubbo_writestring(p_packet, p_st_body_data, (char *)APM_REPORT_KEY_TRANS_TITLE);
    if (i_ret == FR_FAIL)
        return APM_L7_ANALYZE_FAIL;

    //取ParameterType
    i_ret = serialize_dubbo_writestring(p_packet, p_st_body_data, (char *)"request.rpc.parameter.types");
    if (i_ret == FR_FAIL)
        return APM_L7_ANALYZE_FAIL;

    //循环取参数
    while(p_packet->ui_remaining > 1)
    {
        memset(arr_name, 0x00, sizeof(arr_name));
        snprintf(arr_name, sizeof(arr_name), "request.rpc.arg.%d", i_count+1);
        if (serialize_dubbo_readobject(p_packet, p_st_body_data, arr_name) == FR_FAIL)
            return APM_L7_ANALYZE_FAIL;
        i_count += 1;
    }

    if (frreport_body_l7_add_int(p_st_body_data, "request.rpc.arg.size", i_count-1) == FR_FAIL)
        return APM_L7_ANALYZE_FAIL;

    return APM_L7_ANALYZE_SUCC;
}
